﻿$(document).ready(function () {
    //tab
    tab($("#J_tab"));
});

//tab
function tab(element) {
    element.find(".tab-holder").children().mouseover(function (event) {
        event.stopPropagation();
        $(this).parent().find(".tab-current").removeClass("tab-current");
        $(this).addClass("tab-current");
        var eq = $.inArray(this, $.makeArray(element.find(".tab-holder").children()));
        //element.find(".tab-panel").children().not(element.find(".tab-panel").children().eq(eq)).fadeOut(200, function () { element.find(".tab-panel").children().eq(eq).fadeIn(900); });
        element.find(".tab-panel").children().not(element.find(".tab-panel").children().eq(eq)).hide();
        element.find(".tab-panel").children().eq(eq).show();
    }).eq(0).mouseover().mouseout(function (event) { event.stopPropagation(); }).mouseout();
    var href = element.find(".tab-holder a");
    if (href.attr("href") == "" || href.attr("href") == "#" || href.attr("href") == null) { href.attr("href", "javascript:void(0)"); }
};